<style lang="less" scoped>
.panel {
  margin-bottom: 10px;
  &-title {
    display: flex;
    padding: 10px;
    border-bottom: 0.1px solid #eaeaea;
    background: white;

    &__label {
      flex: 1;
      font-size: 16px;
      align-items: center;
    }
  }
  &-content {
    margin-bottom: 10px;
    background: white;

    &__item {
      display: flex;
      padding: 10px 10px 0 10px;
      font-size: 14px;
      &-label {
        color: #666;
        padding-right: 15px;
        // flex: 1;
      }
      &-value {
        flex: 1;
        // padding-left: 15px;
        color: #333;
        word-break: break-all;
      }
    }
  }
}
</style>

<template>
  <div>
    <load v-if="loading"></load>
    <div v-else-if="items.length==0" class="info">暂无数据</div>
    <div class="panel" v-else>
      <template v-for="(item, index) in items" wx:key="unique">
        <!-- title -->
        <div class="panel-title" :key="'title'+index">
          <div class="panel-title__label" v-html="item.Name"></div>
          <div class="panel-title__right"></div>
        </div>
        <!-- content -->
        <div class="panel-content" :key="'content'+index">
          <div class="panel-content__item">
            <div class="panel-content__item-label">识别号</div>
            <div class="panel-content__item-value">{{item.No}}</div>
            <div class="panel-content__item-right"></div>
          </div>
          <div class="panel-content__item">
            <div class="panel-content__item-label">纳税信用评级:</div>
            <div class="panel-content__item-value">{{item.Level}}</div>
            <div class="panel-content__item-right"></div>
          </div>
          <div class="panel-content__item">
            <div class="panel-content__item-label">评价年度:</div>
            <div class="panel-content__item-value">{{item.Year}}</div>
            <div class="panel-content__item-right"></div>
          </div>
        </div>
      </template>
    </div>
  </div>
</template>
<script>
import Load from '@/components/load';
export default {
  components: { Load },
  computed: {
    loading() {
      return this.$store.getters.loading;
    }
  },
  data() {
    return {
      items: []
    };
  },
  onLoad() {
    this.getInfos();
  },
  methods: {
    async getInfos() {
      const url = '/xcx/getTaxesList';
      const params = {
        unique: this.$route.query.Unique,
        pageIndex: 1
      };
      const res = await this.$http.get(url, params);
      if (res.status != 200) {
        wx.showToast({
          title: res.message || '获取失败！',
          icon: 'none',
          mask: true
        });
        return;
      }
      this.items = res.Result;
    }
  }
};
</script>
